/**     
 * @Title: IndexController.java   
 * @Package me.springboot.springfox.web   
 * @Description: TODO
 * @author weiwei 
 * @date 2017年8月11日 下午4:11:22   
 * @version V1.0     
 */
package me.springboot.springfox.web;

import me.springboot.springfox.domain.TreeInfo;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: IndexController
 * @Description: TODO
 * @author weiwei
 * @date 2017年8月11日 下午4:11:22
 * 
 */
@RestController
@RequestMapping("api/v1/")
public class IndexController {

	@RequestMapping(value = "list", method = RequestMethod.GET)
	public String list() {
		return "list";
	}

	/**
	 * 根据ID删除数据
	 * @param id
	 *            根据ID删除数据
	 * @return
	 */
	@RequestMapping(value = "delete/{id}", method = RequestMethod.GET)
	public String delete(@PathVariable int id) {
		return "delete";
	}

	@RequestMapping(value = "save", method = RequestMethod.POST)
	public String save(TreeInfo info) {
		return "save";
	}

	@RequestMapping(value = "detail/id_{id}", method = RequestMethod.GET)
	public String detail(@PathVariable int id) {
		return "detail";
	}
}
